<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    Promise.all([
      new Promise((resolve,reject) => {
        setTimeout(() => {
          resolve('成功了1')
        },2000)
      }),
      new Promise((resolve, reject) => {
        setTimeout(() => {
          resolve('成功了2')
        },1000)
      })
    ]).then((data) => {
      // 都是两秒后打印的
      console.log(data[0])
      console.log(data[1])
    })
  </script>
</body>
</html>